// .Home页面
import request from '../utils/request'
import { getToken } from '@/utils/storage'
// 1.home页面的轮播图接口
export const getSwipeList = () => {
  return request({
    url: '/home/swiper'
  })
}
// 2.home页面的租房小组接口
export const getGroups = (area) => {
  return request({
    // url: 'home/groups?area=AREA%7C88cff55c-aaa4-e2e0',
    url: '/home/groups',
    params: {
      area: area
    }
  })
}
// 3.home页面的最新资讯接口
export const NewsApis = (area) => {
  return request({
    url: '/home/news',
    params: {
      area: area
    }
  })
}

// 4.通过ip定位获取当前城市的名称
// 根据城市名称查询该城市信息
export const CityNameApis = ({ name }) => {
  return request({
    url: '/area/info',
    params: {
      name: name
    }
  })
}

// 发布房屋所需要的条件
export const HousesParams = () => {
  return request({
    url: '/houses/params',
    params: {
      authorization: getToken()
    }
  })
}
